<!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webgl - geometry - cube</title>
		<meta charset="utf-8">
		<style>
			body {
				margin: 0px;
				background-color: #000000;
				overflow: hidden;
			}
		</style>
	</head>
	<body>

		<script src="./libs/three.min.js"></script>

		<script>

			var camera, scene, renderer;
			var mesh;

			init();
			animate();

			function init() {

				renderer = new THREE.WebGLRenderer();
				renderer.setSize( window.innerWidth, window.innerHeight );
				document.body.appendChild( renderer.domElement );

				//

				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
				//camera = new THREE.OrthographicCamera( window.innerWidth / - 4, window.innerWidth / 4, window.innerHeight / 4, window.innerHeight / - 4, 1, 1000 );
				camera.position.z = 300;

				scene = new THREE.Scene();

				//var geometry = new THREE.CubeGeometry( 200, 200, 200 );
				var geometry = new THREE.PlaneGeometry(200, 200  / 32.0*21.0, 1, 10);

				var texture = THREE.ImageUtils.loadTexture( 'textures/rhone.jpg' );
				texture.anisotropy = renderer.getMaxAnisotropy();

				var material = new THREE.MeshBasicMaterial( { map: texture } );

				mesh = new THREE.Mesh( geometry, material );
				mesh.position.x = 0;
				mesh.position.y = 0;
				scene.add( mesh );

				//

				window.addEventListener( 'resize', onWindowResize, false );

			}

			function onWindowResize() {

				camera.aspect = window.innerWidth / window.innerHeight;
				camera.updateProjectionMatrix();

				renderer.setSize( window.innerWidth, window.innerHeight );

			}

			function animate() {

				requestAnimationFrame( animate );

				//mesh.rotation.x += 0.005;
				//mesh.rotation.y += 0.01;

				renderer.render( scene, camera );

			}

		</script>

	</body>
</html>
